package com.humngyang.com.hmy.study.concurrency.myannoations.executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class NewSingleThreadExecutorlExample {
    private static Logger log = LoggerFactory.getLogger(NewSingleThreadExecutorlExample.class);
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i <10000 ; i++) {
                    final int indes  = i;
                    log.info("task {}",indes);
                }
            }
        });
        executorService.shutdown();
    }
}
